﻿using OpenCvSharp.ImgHash;
using Sdcb.PaddleInference;
using Sdcb.PaddleOCR;
using Sdcb.PaddleOCR.Models;
using Sdcb.PaddleOCR.Models.Local;
using SkiaSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AICommon.Paddle.ORC
{
    public static class Recognition
    {
        static QueuedPaddleOcrAll ocr;
        static Recognition()
        {
            ocr = new QueuedPaddleOcrAll(() => new PaddleOcrAll(LocalFullModels.ChineseV3));
        }

        public static void TestPic(string filePath)
        {
            var mat = OpenCvSharp.Mat.FromImageData(File.ReadAllBytes(filePath));
            var result = ocr.Run(mat).Result;
            Console.WriteLine(result);
        }
    }
}
